home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-31 | 533 b | 21 lines | [TEXT/IGR0] |
- #pragma rtGlobals=1
-
- | Median(w, x1, x2)
- | Based on Numerical Recipes in C pp. 476-477.
- | Returns median value of wave w from x=x1 to x=x2.
- | Pass -INF and +INF for x1 and x2 to get median of the entire wave.
- Function Median(w, x1, x2)
- Wave w
- Variable x1, x2
-
- Variable result
-
- Duplicate/R=(x1, x2) w, tempMedianWave | Make a clone of wave
- Sort tempMedianWave, tempMedianWave | Sort clone
- SetScale/P x 0,1,tempMedianWave
- result = tempMedianWave((numpnts(tempMedianWave)-1)/2)
- KillWaves tempMedianWave
-
- return result
- End
-